//
//  DXWMeViewController.m
//  BuDeJie
//
//  Created by 淡馨慰 on 16/7/24.
//  Copyright © 2016年 淡馨慰. All rights reserved.
//

#import "DXWMeViewController.h"
#import "DXWSettingViewController.h"

@interface DXWMeViewController ()

@end

@implementation DXWMeViewController


- (void)viewDidLoad {
    [super viewDidLoad];
    
    
    //1.设置导航条按钮
    [self setupNavigationBar];
    
    //1.2设置中间标题图
    self.navigationItem.title = @"我的";
    
}

- (void)setupNavigationBar
{
    //1.1设置左侧按钮1
    //夜间模式按钮,在点击的时候是保持选择状态 -- 在分类中新添一个方法是selected状态的方法

    UIBarButtonItem *rightBtn = [UIBarButtonItem barButtonItemWithImage:[UIImage imageNamed:@"mine-moon-icon"] selectedImage:[UIImage imageNamed:@"mine-moon-icon-click"] target:self action:@selector(nightBtnClick:)];
    //1.2设置左侧按钮1
    UIBarButtonItem *rightBtn1 = [UIBarButtonItem barButtonItemWithImage:[UIImage imageNamed:@"mine-setting-icon"] highlightImage:[UIImage imageNamed:@"mine-setting-icon-click"] target:self action:@selector(settingBtnClick)];
    
    self.navigationItem.rightBarButtonItems = @[rightBtn1,rightBtn];

    
}
//监听左侧按钮点击
//监听夜间按钮的状态,每次点击取反
- (void)nightBtnClick:(UIButton *)btn
{
    btn.selected = !btn.selected;
    NSLog(@"点击了夜间按钮");
}
- (void)settingBtnClick
{
    NSLog(@"点击了设置按钮");
    DXWSettingViewController *settingVC = [[DXWSettingViewController alloc]init];
    //
    settingVC.hidesBottomBarWhenPushed = YES;
    [self.navigationController pushViewController:settingVC animated:YES];
    
}



#pragma mark - Table view data source

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
#warning Incomplete implementation, return the number of sections
    return 0;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
#warning Incomplete implementation, return the number of rows
    return 0;
}

/*
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:<#@"reuseIdentifier"#> forIndexPath:indexPath];
    
    // Configure the cell...
    
    return cell;
}
*/

/*
// Override to support conditional editing of the table view.
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath {
    // Return NO if you do not want the specified item to be editable.
    return YES;
}
*/

/*
// Override to support editing the table view.
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
    if (editingStyle == UITableViewCellEditingStyleDelete) {
        // Delete the row from the data source
        [tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationFade];
    } else if (editingStyle == UITableViewCellEditingStyleInsert) {
        // Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view
    }   
}
*/

/*
// Override to support rearranging the table view.
- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath {
}
*/

/*
// Override to support conditional rearranging of the table view.
- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath {
    // Return NO if you do not want the item to be re-orderable.
    return YES;
}
*/

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
